# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=linbox
pkgver=1.7.0
pkgrel=1
pkgdesc='A template library for exact, high-performance linear algebra computation with dense, sparse, and structured matrices over the integers and over finite fields'
arch=(loong64 x86_64)
url='https://linalg.org/'
license=(LGPL)
depends=(fflas-ffpack)
makedepends=(m4rie flint iml fplll)
source=(https://github.com/linbox-team/linbox/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('6d2159fd395be0298362dd37f6c696676237bc8e2757341fbc46520e3b466bcc')

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr --enable-sage --with-fplll=/usr
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool # fix overlinking
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
